package com.infocollect.project.api.ui;


import com.infocollect.project.api.entity.TappProcAuditEntity;
import com.infocollect.project.api.service.ITappProcAuditService;
import com.infocollect.project.form.vo.R;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * (TappProcaudit)表控制层
 *
 * @author makejava
 * @since 2019-12-25 10:32:30
 */
@Api(value = "tappProcaudit", tags = "审批信息")
@RestController
@RequestMapping("tappProcaudit")
public class TappProcauditController {
    /**
     * 服务对象
     */
    @Resource
    private ITappProcAuditService tappProcauditService;
    /**
     * 服务对象
     */
    @Resource
    private com.infocollect.project.api.service.ITappActinsService ITappActinsService;
    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public R<TappProcAuditEntity> selectOne(Long id) {
        return R.newOk( this.tappProcauditService.queryById(id));
    }

    @PostMapping("GetProcAudit")
    @ResponseBody
    public R<List<TappProcAuditEntity>> GetProcAudit(@RequestBody Map<String, String> param){
     if(param.get("procinstanceid")==null||param.get("procinstanceid").equals("")){
         return R.newError("传入参数错误！");
     }
     Long procinstanceid=Long.parseLong(param.get("procinstanceid"));
        TappProcAuditEntity tappProcaudit=new TappProcAuditEntity();
        tappProcaudit.setFprocinsid(procinstanceid);
        List<TappProcAuditEntity> tappProcauditList= this.tappProcauditService.GetProcAudit(tappProcaudit);
        return R.newOk( tappProcauditList);
    }

}